<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-CPP: TDateTime类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-CPP
   </div>
   <div id="projectbrief">AWTK CPP API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="class_t_date_time-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">TDateTime类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a267a94e932a9901faad05fe4448e901b"><td class="memItemLeft" align="right" valign="top"><a id="a267a94e932a9901faad05fe4448e901b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TDateTime</b> (date_time_t *nativeObj)</td></tr>
<tr class="separator:a267a94e932a9901faad05fe4448e901b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07e587547eda97c2bf7b2385e7520318"><td class="memItemLeft" align="right" valign="top"><a id="a07e587547eda97c2bf7b2385e7520318"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TDateTime</b> (const date_time_t *nativeObj)</td></tr>
<tr class="separator:a07e587547eda97c2bf7b2385e7520318"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef712604bfd25647022f50024026cdcd"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#aef712604bfd25647022f50024026cdcd">Set</a> ()</td></tr>
<tr class="separator:aef712604bfd25647022f50024026cdcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28627e07d81bc96254bd6c9e2c1c4bd8"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a28627e07d81bc96254bd6c9e2c1c4bd8">FromTime</a> (uint64_t time)</td></tr>
<tr class="separator:a28627e07d81bc96254bd6c9e2c1c4bd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63840776299c0f42d3f3a0d8948d2ce4"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a63840776299c0f42d3f3a0d8948d2ce4">Destroy</a> ()</td></tr>
<tr class="separator:a63840776299c0f42d3f3a0d8948d2ce4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46d80192d883027677bcd01afce27bd1"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a46d80192d883027677bcd01afce27bd1">GetSecond</a> () const</td></tr>
<tr class="separator:a46d80192d883027677bcd01afce27bd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34372c20e28da037c01f96b49ec90a66"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a34372c20e28da037c01f96b49ec90a66">GetMinute</a> () const</td></tr>
<tr class="separator:a34372c20e28da037c01f96b49ec90a66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91d867390b1a6b591be9fe11c0701278"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a91d867390b1a6b591be9fe11c0701278">GetHour</a> () const</td></tr>
<tr class="separator:a91d867390b1a6b591be9fe11c0701278"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83703cdb4e5cc693f27b125fb63c2ffe"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a83703cdb4e5cc693f27b125fb63c2ffe">GetDay</a> () const</td></tr>
<tr class="separator:a83703cdb4e5cc693f27b125fb63c2ffe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa84a65eea32263946c4a5eea9c712cdf"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#aa84a65eea32263946c4a5eea9c712cdf">GetWday</a> () const</td></tr>
<tr class="separator:aa84a65eea32263946c4a5eea9c712cdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b27c331829c152e5ffd9e66dabd71f2"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a2b27c331829c152e5ffd9e66dabd71f2">GetMonth</a> () const</td></tr>
<tr class="separator:a2b27c331829c152e5ffd9e66dabd71f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a550dbdb5529522cd94e4793452fe886c"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a550dbdb5529522cd94e4793452fe886c">GetYear</a> () const</td></tr>
<tr class="separator:a550dbdb5529522cd94e4793452fe886c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:ace5377d01708673233fb810f9831217c"><td class="memItemLeft" align="right" valign="top"><a id="ace5377d01708673233fb810f9831217c"></a>
static <a class="el" href="class_t_date_time.html">TDateTime</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (date_time_t *nativeObj)</td></tr>
<tr class="separator:ace5377d01708673233fb810f9831217c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a695305d464989eaa4bd33a394223ec4a"><td class="memItemLeft" align="right" valign="top"><a id="a695305d464989eaa4bd33a394223ec4a"></a>
static <a class="el" href="class_t_date_time.html">TDateTime</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const date_time_t *nativeObj)</td></tr>
<tr class="separator:a695305d464989eaa4bd33a394223ec4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a767f92f2b0d91f90298445768c207cba"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_t_date_time.html">TDateTime</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_date_time.html#a767f92f2b0d91f90298445768c207cba">Create</a> ()</td></tr>
<tr class="separator:a767f92f2b0d91f90298445768c207cba"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:a769dc4a96727af462e6841b897e06dea"><td class="memItemLeft" align="right" valign="top"><a id="a769dc4a96727af462e6841b897e06dea"></a>
date_time_t *&#160;</td><td class="memItemRight" valign="bottom"><b>nativeObj</b></td></tr>
<tr class="separator:a769dc4a96727af462e6841b897e06dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>日期时间。</p>
<blockquote class="doxtable">
<p>在嵌入式平台中，在系统初始时，需要调用date_time_global_init设置实际获取/设置系统时间的函数。 </p>
</blockquote>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a767f92f2b0d91f90298445768c207cba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a767f92f2b0d91f90298445768c207cba">&#9670;&nbsp;</a></span>Create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_date_time.html">TDateTime</a> TDateTime::Create </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建date_time对象，并初始为当前日期和时间(一般供脚本语言中使用)。</p>
<dl class="section return"><dt>返回</dt><dd>返回date_time对象。 </dd></dl>

</div>
</div>
<a id="a63840776299c0f42d3f3a0d8948d2ce4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63840776299c0f42d3f3a0d8948d2ce4">&#9670;&nbsp;</a></span>Destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TDateTime::Destroy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>销毁date_time对象(一般供脚本语言中使用)。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a28627e07d81bc96254bd6c9e2c1c4bd8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28627e07d81bc96254bd6c9e2c1c4bd8">&#9670;&nbsp;</a></span>FromTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TDateTime::FromTime </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>time</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>从time转换而来。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">time</td><td>时间。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a83703cdb4e5cc693f27b125fb63c2ffe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a83703cdb4e5cc693f27b125fb63c2ffe">&#9670;&nbsp;</a></span>GetDay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TDateTime::GetDay </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>日(1-31)。 </p>

</div>
</div>
<a id="a91d867390b1a6b591be9fe11c0701278"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a91d867390b1a6b591be9fe11c0701278">&#9670;&nbsp;</a></span>GetHour()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TDateTime::GetHour </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>时(0 - 23)。 </p>

</div>
</div>
<a id="a34372c20e28da037c01f96b49ec90a66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34372c20e28da037c01f96b49ec90a66">&#9670;&nbsp;</a></span>GetMinute()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TDateTime::GetMinute </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>分(0 - 59)。 </p>

</div>
</div>
<a id="a2b27c331829c152e5ffd9e66dabd71f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b27c331829c152e5ffd9e66dabd71f2">&#9670;&nbsp;</a></span>GetMonth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TDateTime::GetMonth </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>月(1-12)。 </p>

</div>
</div>
<a id="a46d80192d883027677bcd01afce27bd1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46d80192d883027677bcd01afce27bd1">&#9670;&nbsp;</a></span>GetSecond()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TDateTime::GetSecond </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>秒(0 - 59)。 </p>

</div>
</div>
<a id="aa84a65eea32263946c4a5eea9c712cdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa84a65eea32263946c4a5eea9c712cdf">&#9670;&nbsp;</a></span>GetWday()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TDateTime::GetWday </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>星期几(0-6, Sunday = 0)。 </p>

</div>
</div>
<a id="a550dbdb5529522cd94e4793452fe886c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a550dbdb5529522cd94e4793452fe886c">&#9670;&nbsp;</a></span>GetYear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TDateTime::GetYear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>年。 </p>

</div>
</div>
<a id="aef712604bfd25647022f50024026cdcd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef712604bfd25647022f50024026cdcd">&#9670;&nbsp;</a></span>Set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TDateTime::Set </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置当前时间。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a></li>
<li>output/awtk_cpp.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
